{% load static %}

<!--用于继承-->
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="x-dns-prefetch-control" content="on"/>
    <meta http-equiv="X-UA-Compatible" content="IE=11,IE=10,IE=9,IE=8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-title" content="Python小组">
    <title>Python个人博客网站</title>
    <script type='text/javascript' src='{% static "blogapp/js/jquery.min.js" %}'></script>
    <link href="{% static 'blogapp/images/title.ico' %}" rel="icon" type="image/x-ico">
    <link rel='stylesheet' id='bootstrap-css' href='{% static "blogapp/css/bootstrap.min.css" %}' type='text/css'
          media='all'/>
    <link rel='stylesheet' id='fontawesome-css' href='{% static "blogapp/css/font-awesome.min.css" %}' type='text/css'
          media='all'/>
    <link rel='stylesheet' id='stylesheet-css' href='{% static "blogapp/css/style.css" %}' type='text/css' media='all'/>
    <link rel='stylesheet' id='raxus-css' href='{% static "blogapp/css/raxus.css" %}' type='text/css' media='all'/>
    <link rel='stylesheet' id='open-social-style-css' href='{% static "blogapp/css/os.css" %}' type='text/css'
          media='all'/>
    <meta name='robots' content='index,follow'/>
    <meta name="keywords" content="互联网,产品经理,产品设计,用户体验,交互设计,网站运营,移动互联网">
    <meta name="description" content="聚焦互联网前沿资讯，网络精华内容，交流产品心得。 每天为你速递最新、最鲜、最有料的互联网科技资讯！">
</head>
<body class="home blog site-layout-2" onload="get_curr_time()">
<!-- 头部 -->
<header class="fix-wrap" id="fix-wrap">

    <div class="fix-main clearfix pr" id="fix-main" _hover-ignore="1">
        {% if user.is_authenticated %}
            <span class="username">欢迎, {{ user.username }}!</span>
            <a href="{% url 'blogapp:logout' %}" class="btn btn-danger">登出</a>
        {% else %}
            <a href="{% url 'blogapp:login' %}" class="btn btn-primary">登录</a>
        {% endif %}

        <a href="{% url 'blogapp:index' %}" class="index-logo">
            <img class="logoimg" src="{% static 'blogapp/picture/black-logo2.png' %}" alt="个人博客网站"/>
        </a>
        <nav class="nav fl">
            <ul id="fix-list" class="fix-list clearfix">
                <li id="menu-item-24086" class="menu-item"><a href="{% url 'blogapp:index' %}">首页</a></li>
                {% for cate in cates %}
                    <li id="menu-item-117720" class="menu-item">
                        <a href="{% url 'blogapp:article_list' cate.code %}">{{ cate.name }}</a>
                    </li>
                {% endfor %}
                <li id="menu-item-24086" class="menu-item"><a href="{% url 'blogapp:about' %}">关于</a></li>
            </ul>
        </nav>

        <!-- 搜索栏 -->
        <form method="get" class="index-search hidden-xs" action="{% url 'blogapp:search' %}">
            <input class="text" name="keywords" type="text" placeholder="输入关键字" value="{{ keywords }}">
            <button class="submit" type="submit"><i class="fa fa-search"></i></button>
        </form>
        <a class="btn btn-primary ms-2" href="{% url 'blogapp:create_article' %}">新增文章</a>
    </div>

</header>

{% block content %}
{% endblock %}

<!-- 底部 -->
<footer class="footer">
    <div class="copyright"> © 2020-2021 · All Rights Reserved

    </div>
</footer>
{#<script src="{% static "blogapp/js/bundle.js" %}"></script>#}
<script type="text/javascript" src="{% static "blogapp/js/view-history.js" %}"></script>
<script type='text/javascript' src="{% static "blogapp/js/push.js" %}"></script>
<script type='text/javascript' src='{% static "blogapp/js/jquery.min.js" %}'></script>
<script type='text/javascript' src='{% static "blogapp/js/bootstrap.min.js" %}'></script>
<script type='text/javascript' src='{% static "blogapp/js/raxus-slider.min.js" %}'></script>
<script type='text/javascript' src='{% static "blogapp/js/loader.js" %}'></script>
<script type='text/javascript' src='{% static "blogapp/js/bj-lazy-load.min.js" %}'></script>
<script type='text/javascript' src='{% static "blogapp/js/os.js" %}'></script>
<script>
    //if($){
        //alert("引入jquery");
    //}else{
       // alert("没有引入jquery");
    //}

    // 鼠标离开图片的缩放效果
    $(function () {
        $('.wp-post-image').mouseout(function () {
            //alert(this);
            $(this).addClass('wp-post-image-mouseout');
        });

    });

    // 给aboute.html添加时间
    function get_curr_time(){
        var today = new Date();
        var year = today.getFullYear();
        var month = today.getMonth() + 1;
        var date = today.getDate();
        var hour = today.getHours();
        var minutes = today.getMinutes();
        var second = today.getSeconds();
        hour = zero_prefix(hour);
        minutes = zero_prefix(minutes);
        second = zero_prefix(second);
        //alert(year+'年'+month+'月'+date+'日 '+hour+':'+minutes+':'+second);
        $('#get_curr_time').text(year+'年'+month+'月'+date+'日 '+hour+':'+minutes+':'+second);
        setTimeout('get_curr_time()', 1000);

    }

    // 时间数字不足10补零前缀
    function zero_prefix(t){
        if(t<10){
            t = '0' + t;
        }
        return t;
    }

</script>
</body>
</html>
